package com.xintoucloud.pbs.entity;

import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToMany;
import javax.persistence.Table;

import org.hibernate.annotations.Target;

@Entity@Table(name="p_menu")
public class Menu {
	@Id@GeneratedValue(strategy=GenerationType.IDENTITY)
	private Integer id;
	private String menuName;
	private String iconCls;
	private String url;
	private int parentId;
	@JoinColumn(name="Menu_id",nullable=true)
	@ManyToMany(cascade=CascadeType.ALL,fetch=FetchType.LAZY,targetEntity=PartyMemberPermission.class)
	private Set<PartyMemberPermission> partyMemberPermissions;
	
	public Set<PartyMemberPermission> getPartyMemberPermissions() {
		return partyMemberPermissions;
	}
	public void setPartyMemberPermissions(Set<PartyMemberPermission> partyMemberPermissions) {
		this.partyMemberPermissions = partyMemberPermissions;
	}
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	public String getMenuName() {
		return menuName;
	}
	public void setMenuName(String menuName) {
		this.menuName = menuName;
	}
	public String getIconCls() {
		return iconCls;
	}
	public void setIconCls(String iconCls) {
		this.iconCls = iconCls;
	}
	
	public String getUrl() {
		return url;
	}
	public void setUrl(String url) {
		this.url = url;
	}
	public int getParentId() {
		return parentId;
	}
	public void setParentId(int parentId) {
		this.parentId = parentId;
	}
	
	

}
